package com.spring.condition.config;


import com.spring.condition.condition.LinuxCondition;
import com.spring.condition.condition.WindowCondition;
import com.spring.condition.service.LinuxListServiceImpl;
import com.spring.condition.service.ListService;
import com.spring.condition.service.WindwListServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;

/**
 * ClassName: SpringConfig
 * Description:
 * Date: 2017/5/13 17:31
 *
 * @author SAM SHO
 * @version V1.0
 */
@Spring("com.spring.condition")
public class SpringConfig {

    @Bean
    @Conditional(value = {WindowCondition.class})//条件判断
    public ListService windowListService() {
        return new WindwListServiceImpl();
    }

    @Bean
    @Conditional(value = {LinuxCondition.class})
    public ListService linuxListService() {
        return new LinuxListServiceImpl();
    }
}
